package com.gxa.eshps.cores.common;

import com.gxa.eshps.cores.utils.MD5Util;
import org.springframework.stereotype.Component;
/**
 * @program: IntelliJ IDEA
 * @description: 密码加密
 * @author: Mr.Wang
 * @create: 2022-06-16 09:16
 **/
@Component
public class PasswordUtils {

    private final String SALT_PASSWORD = "140ee0001bda4f128640a33f05cb0d16";
    private final Integer LENGTH = 10;

    public String passwordUtils(String pwd){
        String pwdSalts = pwd.trim()+SALT_PASSWORD;
        for (int i = 0; i < LENGTH; i++){
            pwdSalts = MD5Util.encode(pwdSalts);
        }
        return pwdSalts;
    }
}
